﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace g42.Inc
{
  public enum OSTypeEnum
  {
      Windows,
      Linux,
      Mac,
      Unknown
  }

  public static class OSType 
  {
    public static OSTypeEnum Get()
    {
      string msg1 = "This is a Windows operating system.";
      string msg2 = "This is a Unix operating system.";
      string msg3 = "ERROR: This platform identifier is invalid."; OperatingSystem os = Environment.OSVersion;
      PlatformID pid = os.Platform;
      switch (pid)
      {
        case PlatformID.Win32NT:
        case PlatformID.Win32S:
        case PlatformID.Win32Windows:
        case PlatformID.WinCE:
          Console.WriteLine(msg1);
          return OSTypeEnum.Windows;
        case PlatformID.Unix:
          Console.WriteLine(msg2);
          return OSTypeEnum.Linux;
        default:
          Console.WriteLine(msg3);
          return OSTypeEnum.Unknown;
      }
    }

  }

}
